package mytest;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/3/16 22:56
 * 使用 lambda 表达式
 */
public class Thread05Demo {

    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            while (true) {
                System.out.println(Thread.currentThread().getName());
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t.start();
    }
}
